﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MyFirstMVC.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to ASP.NET MVC!";

            return View();
        }

        public ActionResult About()
        {
            return View();
        }
        public ActionResult Logout()
        {
            Dictionary<string, object> sessionVar = (Dictionary<string, object>)Session["vars"];
            DAL.User user = (DAL.User)sessionVar["userVar"];
            user.UpdateLogout(user.Id);
            Session.Abandon();
            return Redirect("~/Default.aspx");
        }
    }
}
